#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pygtk
pygtk.require("2.0")
import gtk
import gtk.glade

from modules import pad_notebook
from modules import pad_menubar

reload(sys)
sys.setdefaultencoding('utf8')

class Main_window:
    def __init__(self):
        self.win            = gtk.Window()
        self.accel_group    = gtk.AccelGroup()
        self.vbox_1         = gtk.VBox()
        self.menubar        = pad_menubar.Pad_menubar(self.win ,self.accel_group)
        self.pad_notebook   = pad_notebook.Pad_notebook()

        self.win.add_accel_group(self.accel_group)
        self.win.set_size_request(0,0)
        self.win.set_default_size(800, 600)
        self.win.set_title('PyPad')
        self.win.drag_dest_set(0, [], 0)

        self.menubar.set_notebook(self.pad_notebook)
        self.menubar.set_mainwindow(self.win)

        self.pad_notebook.set_menubar(self.menubar)

        self.vbox_1.pack_start(self.menubar, False, True)
        self.vbox_1.pack_start(self.pad_notebook, True, True)

        self.win.add(self.vbox_1)

        self.win.show()
        self.vbox_1.show()
        self.menubar.show_all()
        self.pad_notebook.show_all()

        #self.win.set_events(gtk.gdk.ALL_EVENTS_MASK)

        self.win.connect('destroy', gtk.main_quit)
        #self.win.connect('drag_motion', self.test_drag_motion)
        #self.win.connect('drag_drop', self.test_drag_drop)
        #self.win.connect('drag_data_received', self.test_drag_data_received)

#    def test_drag_motion(self, widget, context, x, y ,time):
#        context.drag_status(gtk.gdk.ACTION_COPY, time)
#        print ' '.join([str(t) for t in context.targets])
#        print '\n'

#    def test_drag_drop(self, widget, context, x, y, time):
#        print widget.drag_get_data(context, context.targets[-1], time)

#    def test_drag_data_received(self, context, x, y, data, info, time):
#        print data.get_text()
#        context.finish(True, False, time)
